Skip to content

module: improve detection try catch#52242

Closed
GeoffreyBooth wants to merge 9 commits intonodejs:mainfrom
GeoffreyBooth:fix-try-catch
Closed

module: improve detection try catch#52242
GeoffreyBooth wants to merge 9 commits intonodejs:mainfrom
GeoffreyBooth:fix-try-catch

Conversation

@GeoffreyBooth
Copy link
Member

This refactors the try/catch added in #52093 to happen in C++, so that the rethrown error preserves the same origin, source arrow and source map-translated stack trace. This gets us much closer to being able to unflag --experimental-detect-module and have all the tests pass. The C++ was written by @targos

There’s currently only one test failing on this branch, and I’d love some help getting it to pass. ./node test/parallel/test-debugger-exceptions.js is failing because in node inspect, for some reason the inspector sees the exception as being thrown by the new TryCatchRethrow rather than the rethrown exception. If anyone can figure out why this is and what we can do about it, I would be very grateful. cc @jkrems @nodejs/loaders @nodejs/inspector @nodejs/v8-inspector

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. errors Issues and PRs related to JavaScript errors originated in Node.js core. esm Issues and PRs related to the ECMAScript Modules implementation. module Issues and PRs related to the module subsystem. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants